<?php
$route->any('login', 'AuthController@login')->name('admin.user.login');

//news
$route->any('news/index', 'NewsController@index');
$route->any('news/info', 'NewsController@info');
$route->any('message/store', 'MessageController@store');
$route->any('company/info', 'ConfigController@companyInfo');
$route->get('product/index', 'ProductController@index');
$route->get('product/info', 'ProductController@info');
$route->any('category/index', 'CategoryController@index');
$route->any('material/index', 'MaterialController@index');
//message
$route->any('message/index', 'MessageController@index');

$route->group(['middleware' => 'api.auth'], function ($route) {

    $route->any('upload', '\App\Http\Controllers\PublicController@upload');


    //管理员
    $route->get('admin/index', 'AdminController@index')->name('admin.admin.index');
    $route->get('logout', 'AdminController@logout')->name('admin.admin.logout');
    $route->post('admin/store', 'AdminController@store')->name('admin.admin.store');
    $route->post('password/update', 'AdminController@updatePwd')->name('admin.password.update');

    //hero
    $route->get('hero/index', 'HeroController@index')->name('admin.hero.index');
    $route->get('hero/info', 'HeroController@info')->name('admin.hero.info');
    $route->post('hero/destroy', 'HeroController@destroy')->name('admin.hero.destroy');
    $route->post('hero/update', 'HeroController@update')->name('admin.hero.update');
    $route->get('hero/position', 'HeroController@getPosition')->name('admin.hero.position');
    $route->post('hero/import', 'HeroController@import')->name('admin.hero.import');

    //appoint
    $route->get('appoint/index', 'AppointController@index')->name('admin.appoint.index');
    $route->get('appoint/info', 'AppointController@info')->name('admin.appoint.info');
    $route->post('appoint/update', 'AppointController@update')->name('admin.appoint.update');
    $route->get('appoint/time/range', 'AppointController@timeRange')->name('admin.appoint.time.range');
    $route->any('appoint/destroy', 'AppointController@destroy')->name('admin.appoint.destroy');


    //category
    $route->any('category/edit/status', 'CategoryController@editStatus');
    $route->any('category/store', 'CategoryController@store');
    $route->any('category/info', 'CategoryController@info');
    $route->any('category/destroy', 'CategoryController@destroy');


    //news
    $route->any('news/edit/status', 'NewsController@editStatus');
    $route->any('news/store', 'NewsController@store');
    $route->any('news/destroy', 'NewsController@destroy');

    //material
    $route->any('material/store', 'MaterialController@store');
    $route->any('material/info', 'MaterialController@info');
    $route->any('material/destroy', 'MaterialController@destroy');



    //company
    $route->any('company/store', 'ConfigController@store');

    //product
    $route->any('product/edit/status', 'ProductController@editStatus');
    $route->post('product/store', 'ProductController@store');
    $route->post('product/destroy', 'ProductController@destroy');



});

